var file = document.getElementById('file'),
    portraitImg = document.getElementsByClassName('portraitImg')[0],
    nextBtn = document.getElementsByClassName('nextBtn')[0];

file.onchange = function(){
    var files =  this.files[0];
    var reader = new FileReader();
    reader.readAsDataURL(files);
    reader.onload=function(e){
        portraitImg.src = e.target.result;
    };
    nextBtn.onclick = function () {
        var fd = new FormData;
        fd.append('step', '4');
        fd.append('video', file.files[0]);
        upload({
            url:'http://localhost:8080/register',
            formData:fd,
            success:function (data) {
                console.log(data);
            },
            fail:function (error) {
                console.log(error);
            },
            process:function (e) {
            }
        });
    };
};

// console.log(fd);

